<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<!-- aqui usaremos as tags do JSF -->
<h:head>
	<title>Login</title>
</h:head>

<h:body>
	<center>
		<p:panel header="Loging" style="width:30%;margin-top:10%;">
			<h:form id="frmLogin">

				<h:panelGrid columns="3" cellpadding="5">

					<h:outputLabel for="name" value="Matricula:"
						style="font-weight:bold" />
					<p:inputText id="name" value="#{login.usuario.idUsuario}"
						required="true"
						requiredMessage="Matricula não pode ficar em branco" />
					<p:message for="name" />
					
					<h:outputLabel for="senha" value="Senha:" style="font-weight:bold" />
					<p:password id="senha" value="#{login.usuario.senha}"
						required="true" requiredMessage="Senha não pode ficar em branco" />
					<p:message for="senha" />
					
					<p:commandButton id="btnLogin" value="Submit"
						actionListener="#{login.validaLogin}"  update="messages" />
					<h:outputText id="saida" value="#{login.errorMessage}"
						style="color:red" />
				</h:panelGrid>
				<p:messages id="messages" showDetail="false" autoUpdate="true" closable="true" />
			</h:form>
		</p:panel>
	</center>
</h:body>
</html>